﻿function addCookie() {// 加入收藏夹
	if (document.all) {
		window.external.addFavorite('http://cqggrw.com/', '公共人物网');
	} else if (window.sidebar) {
		window.sidebar.addPanel('公共人物网', 'http://cqggrw.com/', "");
	}
}

function setHomepage() {// 设置首页
	if (document.all) {
		document.body.style.behavior = 'url(#default#homepage)';
		document.body.setHomePage('http://cqggrw.com/');
	} else if (window.sidebar) {
		if (window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			} catch (e) {
				alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
			}
			;
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage', 'http://cqggrw.com/');
	}
	;
}

function getDatetime() {
	var dt = new Date();
	return (dt.getFullYear() + '年' + (dt.getMonth() + 1) + '月' + dt.getDate() + '日    ' + dt.getHours() + ':' + dt.getMinutes() + ':' + dt.getSeconds()).replace(/([\-\: ])(\d{1})(?!\d)/g, '$10$2');
}

function shijian() {
	var mydate = new Date();
	$(".shijan").text(mydate.toLocaleString());
}
function init() {
	shijian();
	setInterval(shijian, 1000);
};